# -*- coding: utf-8 -*-
#  @author  Bink
#  @date  2020/9/17 16:13
# @Email : 2641032316@qq.com


# TODO
#  1、定义学生类:有学号、性别、年龄;方法有:初始化值的方法、输出值的方法
#  2、定义学生类的子类:大学生类，该子类还有课程属性，及修课方法（获得学分及成绩)
#  3，定义学生类的子类:高中生，该子类还有技能属性，及技能方法（输出技能）
#  4、定义公司类，利用多态，实现公司雇佣大学生，雇佣是给就业学生岗位和工资

class Student:
    def __init__(self, no=None, sex=None, age=None):
        self.Sno = no
        self.Ssex = sex
        self.Sage = age

    def setNo(self, no):
        self.Sno = no

    def setSex(self, sex):
        self.Ssex = sex

    def setAge(self, age):
        self.Sage = age

    def __str__(self) -> str:
        return f"{self.__class__.__name__}: Sno = {self.Sno}, Ssex = {self.Ssex}, Sage = {self.Sage}"

    def showInfo(self):
        print(self.__str__())


class CollegeStudent(Student):
    def __init__(self, no=None, sex=None, age=None, *course):
        super().__init__(no, sex, age)
        self.courses = course

    def takeCourse(self):
        for course in self.courses:
            print(course)

    def __str__(self) -> str:
        Courses = "".join(course+", " for course in self.courses)[:-2]
        return super().__str__() + f", Courses = { Courses }"


class HighSchoolStudent(Student):
    def __init__(self, no=None, sex=None, age=None, skill=None):
        super().__init__(no, sex, age)
        self.skill = skill

    def showSkill(self):
        print(self.skill)

    def __str__(self) -> str:
        return super().__str__() + f", Skill = {self.skill}"


class Company:
    __job_salary_list = {"Student": "Unknown",
                         "HighSchoolStudent": "1800/m",
                         "CollegeStudent": "2600/m"}

    @classmethod
    def hireStudent(cls, hiredStudent: Student):
        studentClass = hiredStudent.__class__.__name__
        print(f"岗位：{studentClass}, 薪资：{Company.__job_salary_list.get(studentClass)}")
        hiredStudent.showInfo()
        print()


if __name__ == "__main__":
    student = Student("001", "male", 20)
    highSchoolStudent = HighSchoolStudent("002", "female", 18, "Beer and skittles")
    collegeStudent = CollegeStudent("003", "female", 22, "Time management", "Multiplayer sports")
    Company.hireStudent(student)
    Company.hireStudent(highSchoolStudent)
    Company.hireStudent(collegeStudent)
